home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / CHARTFX.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-13  |  31KB  |  872 lines

  1. unit ChartFX;
  2.  
  3. { Conversion log:
  4.   Property TChartFX.Type renamed to Type_: Identifier is a reserved word
  5.   Array property TChartFX.Const renamed to Const_: Identifier is a reserved word }
  6.  
  7. interface
  8.  
  9. uses Ole2, OleCtl, Classes, Graphics, OleCtrls;
  10.  
  11. const
  12.  
  13. { PointTypeConstants }
  14.  
  15.   CHART_NONEMK = 0;
  16.   CHART_RECTMK = 1;
  17.   CHART_CIRCLEMK = 2;
  18.   CHART_TRIANGLEMK = 3;
  19.   CHART_MARBLEMK = 4;
  20.   CHART_CUBEMK = 5;
  21.   CHART_MANYMK = 6;
  22.  
  23. { SchemeConstants }
  24.  
  25.   CHART_CSSOLID = 0;
  26.   CHART_CSBWPATTERN = 1;
  27.   CHART_CSPATTERN = 2;
  28.  
  29. { StackedConstants }
  30.  
  31.   CHART_NOSTACKED = 0;
  32.   CHART_STACKED = 1;
  33.   CHART_STACKED100 = 2;
  34.  
  35. { GridConstants }
  36.  
  37.   CHART_NOGRID = 0;
  38.   CHART_HORZGRID = 1;
  39.   CHART_VERTGRID = 2;
  40.   CHART_BOTHGRID = 3;
  41.   CHART_GRIDY2 = 4;
  42.  
  43. { GalleryConstants }
  44.  
  45.   LINES = 1;
  46.   BAR = 2;
  47.   SPLINE = 3;
  48.   MARK = 4;
  49.   PIE = 5;
  50.   AREA = 6;
  51.   PARETO = 7;
  52.   SCATTER = 8;
  53.   HILOW = 9;
  54.  
  55. { ConstTypeConstants }
  56.  
  57.   CC_HIDETEXT = 1;
  58.   CC_HIDE = 2;
  59.  
  60. { LegendStyleConstants }
  61.  
  62.   CL_NOTCLIPPED = 1;
  63.   CL_NOTCHANGECOLOR = 2;
  64.   CL_HIDE = 4;
  65.   CL_HIDEXLEG = 4;
  66.   CL_FORCESERLEG = 8;
  67.   CL_GETLEGEND = 16;
  68.   CL_HIDEYLEG = 32;
  69.  
  70. { OpenDataConstants }
  71.  
  72.   COD_VALUES = 1;
  73.   COD_CONSTANTS = 2;
  74.   COD_COLORS = 3;
  75.   COD_STRIPES = 4;
  76.   COD_INIVALUES = 5;
  77.   COD_XVALUES = 6;
  78.   COD_STATUSITEMS = 7;
  79.   COD_UNKNOWN = -1;
  80.   COD_UNCHANGE = 0;
  81.  
  82. { ClickConstants }
  83.  
  84.   CHART_BALLOONCLK = 0;
  85.   CHART_DIALOGCLK = 1;
  86.   CHART_NONECLK = 2;
  87.   CHART_MENUCLK = 3;
  88.  
  89. { DialogConstants }
  90.  
  91.   CDIALOG_EXPORTFILE = 14;
  92.   CDIALOG_IMPORTFILE = 15;
  93.   CDIALOG_WRITETEMPLATE = 8;
  94.   CDIALOG_READTEMPLATE = 9;
  95.   CDIALOG_PAGESETUP = 4;
  96.   CDIALOG_ABOUT = 11;
  97.   CDIALOG_OPTIONS = 12;
  98.   CDIALOG_EDITTITLES = 35;
  99.   CDIALOG_FONTS = 39;
  100.   CDIALOG_ROTATE = 52;
  101.  
  102. { AdmConstants }
  103.  
  104.   CSA_MIN = 0;
  105.   CSA_MAX = 1;
  106.   CSA_GAP = 2;
  107.   CSA_SCALE = 3;
  108.   CSA_YLEGGAP = 4;
  109.   CSA_PIXXVALUE = 5;
  110.   CSA_XMIN = 6;
  111.   CSA_XMAX = 7;
  112.   CSA_XGAP = 8;
  113.   CSA_LOGBASE = 9;
  114.  
  115. { TitleConstants }
  116.  
  117.   CHART_LEFTTIT = 0;
  118.   CHART_RIGHTTIT = 1;
  119.   CHART_TOPTIT = 2;
  120.   CHART_BOTTOMTIT = 3;
  121.  
  122. { FontConstants }
  123.  
  124.   CHART_LEFTFT = 0;
  125.   CHART_RIGHTFT = 1;
  126.   CHART_TOPFT = 2;
  127.   CHART_BOTTOMFT = 3;
  128.   CHART_XLEGFT = 4;
  129.   CHART_YLEGFT = 5;
  130.   CHART_FIXEDFT = 6;
  131.   CHART_LEGENDFT = 7;
  132.  
  133. { ItemConstants }
  134.  
  135.   CI_HORZGRID = 0;
  136.   CI_VERTGRID = 1;
  137.  
  138. { DecimalConstants }
  139.  
  140.   CD_ALL = 0;
  141.   CD_VALUES = 1;
  142.   CD_YLEG = 2;
  143.   CD_XLEG = 3;
  144.  
  145. type
  146.  
  147.   TChartFXLButtonDblClk = procedure(Sender: TObject; var X, Y, nSerie, nPoint, nRes: Smallint) of object;
  148.   TChartFXRButtonDown = procedure(Sender: TObject; var X, Y, nSerie, nPoint, nRes: Smallint) of object;
  149.   TChartFXChangeValue = procedure(Sender: TObject; var dValue: Double; var nSerie, nPoint, nRes: Smallint) of object;
  150.   TChartFXChangeString = procedure(Sender: TObject; var nType, nIndex, nRes: Smallint) of object;
  151.   TChartFXChangeColor = procedure(Sender: TObject; var nType, nIndex, nRes: Smallint) of object;
  152.   TChartFXChangePalette = procedure(Sender: TObject; var nIndex, nRes: Smallint) of object;
  153.   TChartFXChangeFont = procedure(Sender: TObject; var nIndex, nRes: Smallint) of object;
  154.   TChartFXChangePattern = procedure(Sender: TObject; var nType, nIndex, nRes: Smallint) of object;
  155.   TChartFXChangePattPal = procedure(Sender: TObject; var nIndex, nRes: Smallint) of object;
  156.   TChartFXMenu = procedure(Sender: TObject; var wParam, nSerie, nPoint, nRes: Smallint) of object;
  157.   TChartFXChangeType = procedure(Sender: TObject; var nType, nRes: Smallint) of object;
  158.   TChartFXUserScroll = procedure(Sender: TObject; wScrollMsg, wScrollParam: Integer; var nRes: Smallint) of object;
  159.   TChartFXGetLegend = procedure(Sender: TObject; nType: Smallint; var nRes: Smallint) of object;
  160.  
  161.   TChartFX = class(TOleControl)
  162.   private
  163.     FOnLButtonDblClk: TChartFXLButtonDblClk;
  164.     FOnRButtonDown: TChartFXRButtonDown;
  165.     FOnChangeValue: TChartFXChangeValue;
  166.     FOnChangeString: TChartFXChangeString;
  167.     FOnChangeColor: TChartFXChangeColor;
  168.     FOnDestroy: TNotifyEvent;
  169.     FOnReadFile: TNotifyEvent;
  170.     FOnChangePalette: TChartFXChangePalette;
  171.     FOnChangeFont: TChartFXChangeFont;
  172.     FOnReadTemplate: TNotifyEvent;
  173.     FOnChangePattern: TChartFXChangePattern;
  174.     FOnChangePattPal: TChartFXChangePattPal;
  175.     FOnMenu: TChartFXMenu;
  176.     FOnChangeType: TChartFXChangeType;
  177.     FOnUserScroll: TChartFXUserScroll;
  178.     FOnGetLegend: TChartFXGetLegend;
  179.     function Get_Value(index: Smallint): Double; stdcall;
  180.     procedure Set_Value(index: Smallint; Value: Double); stdcall;
  181.     function Get_XValue(index: Smallint): Double; stdcall;
  182.     procedure Set_XValue(index: Smallint; Value: Double); stdcall;
  183.     function Get_IniValue(index: Smallint): Double; stdcall;
  184.     procedure Set_IniValue(index: Smallint; Value: Double); stdcall;
  185.     function Get_Const_(index: Smallint): Double; stdcall;
  186.     procedure Set_Const_(index: Smallint; Value: Double); stdcall;
  187.     function Get_Color(index: Smallint): TColor; stdcall;
  188.     procedure Set_Color(index: Smallint; Value: TColor); stdcall;
  189.     function Get_BkColor(index: Smallint): TColor; stdcall;
  190.     procedure Set_BkColor(index: Smallint; Value: TColor); stdcall;
  191.     function Get_Adm(index: Smallint): Double; stdcall;
  192.     procedure Set_Adm(index: Smallint; Value: Double); stdcall;
  193.     function Get_Pattern(index: Smallint): Smallint; stdcall;
  194.     procedure Set_Pattern(index: Smallint; Value: Smallint); stdcall;
  195.     function Get_Fonts(index: Smallint): Integer; stdcall;
  196.     procedure Set_Fonts(index: Smallint; Value: Integer); stdcall;
  197.     function Get_Title(index: Smallint): string; stdcall;
  198.     procedure Set_Title(index: Smallint; const Value: string); stdcall;
  199.     function Get_Legend(index: Smallint): string; stdcall;
  200.     procedure Set_Legend(index: Smallint; const Value: string); stdcall;
  201.     function Get_SerLeg(index: Smallint): string; stdcall;
  202.     procedure Set_SerLeg(index: Smallint; const Value: string); stdcall;
  203.     function Get_KeyLeg(index: Smallint): string; stdcall;
  204.     procedure Set_KeyLeg(index: Smallint; const Value: string); stdcall;
  205.     function Get_FixLeg(index: Smallint): string; stdcall;
  206.     procedure Set_FixLeg(index: Smallint; const Value: string); stdcall;
  207.     function Get_YLeg(index: Smallint): string; stdcall;
  208.     procedure Set_YLeg(index: Smallint; const Value: string); stdcall;
  209.     function Get_KeySer(index: Smallint): string; stdcall;
  210.     procedure Set_KeySer(index: Smallint; const Value: string); stdcall;
  211.     function Get_StatusText(index: Smallint): string; stdcall;
  212.     procedure Set_StatusText(index: Smallint; const Value: string); stdcall;
  213.     function Get_RGBFont(index: Smallint): TColor; stdcall;
  214.     procedure Set_RGBFont(index: Smallint; Value: TColor); stdcall;
  215.     function Get_HFont(index: Smallint): Smallint; stdcall;
  216.     procedure Set_HFont(index: Smallint; Value: Smallint); stdcall;
  217.     function Get_ItemWidth(index: Smallint): Smallint; stdcall;
  218.     procedure Set_ItemWidth(index: Smallint; Value: Smallint); stdcall;
  219.     function Get_ItemStyle(index: Smallint): Smallint; stdcall;
  220.     procedure Set_ItemStyle(index: Smallint; Value: Smallint); stdcall;
  221.     function Get_ItemColor(index: Smallint): TColor; stdcall;
  222.     procedure Set_ItemColor(index: Smallint; Value: TColor); stdcall;
  223.     function Get_DecimalsNum(index: Smallint): Smallint; stdcall;
  224.     procedure Set_DecimalsNum(index: Smallint; Value: Smallint); stdcall;
  225.   protected
  226.     procedure InitControlData; override;
  227.   public
  228.     function OpenDataEx(nType: Smallint; n1, n2: Integer): Integer; stdcall;
  229.     function CloseData(nType: Smallint): TOleBool; stdcall;
  230.     function DblClk(nType: Smallint; lExtra: Integer): Integer; stdcall;
  231.     function RigClk(nType: Smallint; lExtra: Integer): Integer; stdcall;
  232.     function Status(nItems: Smallint; lpStatus: Integer): Integer; stdcall;
  233.     function ShowDialog(nDialog: Smallint; lExtra: Integer): Integer; stdcall;
  234.     function PrintIt: Integer; stdcall;
  235.     function Scroll(wParam, lParam: Integer): Integer; stdcall;
  236.     function SetStatusItem(index: Smallint; bText: TOleBool; nID: Smallint;